<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    
    <ui:composition template="/template/principal.xhtml">
        <ui:define name="conteudo">
            <h:form>
                <p:panel header="Cadastro de Usuario">
                    <p:focus/>
                    <p:messages globalOnly="true"/>
                    <p:tabView >
                        <p:tab title="Dados da Usuario" >
                            <h:panelGrid columns="3">
                                <h:outputText value="Login:"/>
                                <p:inputText id="login" value="#{usuario.usuario.userlogin}" size="20" maxlength="20" required="true" requiredMessage="Campo Obrigatorio"/>
                                <p:message for="login"/>
                                <h:outputText value="Nova Senha: " />  
                                <p:password id="senha1" value="#{usuario.usuario.senha}" 
                                            feedback="true" required="true" 
                                            maxlength="100" requiredMessage="Campo Obrigatorio" 
                                            minLength="6" promptLabel="Por favor insira a senha, minimo 6 caracteres" weakLabel="Fraca"  
                                            goodLabel="Boa" strongLabel="Excelente" />  
                                <p:message for="senha1"/>
                                
                                <h:outputText value="Escolha o Nivel de acesso do usuario: "/>
                                <h:selectOneMenu id="estado" value="#{usuario.usuario.acesso}" required="true" requiredMessage="Campo Obrigatório">
                                    <f:selectItem noSelectionOption="true" itemLabel="-- Selecione um Nivel --" itemValue=""/>
                                    <f:selectItem itemValue="ADM" itemLabel="Administrador"/>
                                    <f:selectItem itemValue="CLI" itemLabel="Cliente"/>
                                    <f:selectItem itemValue="TEC" itemLabel="Tecnico"/>
                                </h:selectOneMenu>
                                <p:message for="estado"/>
                            </h:panelGrid>
                            <h:panelGrid columns="2">
                                <h:commandButton value="Salvar" action="#{usuario.salvar2}"/>
                                <h:commandButton value="Limpar" type="reset"/>
                            </h:panelGrid>        
                        </p:tab>
                    </p:tabView>
                </p:panel>
            </h:form>

        </ui:define>
    </ui:composition>
</html>


